package com.tunnel.home.dao;

import java.util.List;

import org.axe.annotation.persistence.Dao;
import org.axe.annotation.persistence.Sql;
import org.axe.interface_.persistence.BaseRepository;

import com.tunnel.home.entity.Domain;

@Dao
public interface DomainDao extends BaseRepository{
	
	@Sql("select * from Domain where userId=?1 order by createTime asc")
	public List<Domain> getList(long userId);
	
	@Sql("select * from Domain where name=?1")
	public Domain get(String name);
	
	@Sql("select count(1) from Domain where userId=?1")
	public int count(long userId);
	
	@Sql("set Domain mapping=?3 where name=?2 and userId=?1")
	public int setMapping(long userId,String name,String mapping);
	
	@Sql("select count(1) from Domain where userId=?1 and name in(?2)")
	public int count(long userId,List<String> domainList);
	
}
